
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Spring的底层原理 - 学习卡片</title>
      <style>
        body { font-family: sans-serif; background-color: #f0f8ff; color: #333; display: flex; flex-direction: column; align-items: center; padding: 50px 20px; }
        .header h1 { font-size: 32px; }
        .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: 100%; max-width: 1200px; }
        .card-container { perspective: 1200px; cursor: pointer; height: 250px; }
        .card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
        .card-container.flipped .card { transform: rotateY(180deg); }
        .card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 16px; background-color: #fff; padding: 24px; }
        .card-back { background-color: #f0fff4; transform: rotateY(180deg); justify-content: space-between; }
        .card-category { font-size: 14px; color: #0052d9; margin-bottom: 8px; font-weight: 500; }
        .card-question { font-size: 20px; font-weight: 500; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
        .card-answer-wrapper { flex-grow: 1; overflow-y: auto; }
        .card-answer { font-size: 15px; line-height: 1.7; }
        .card-footer { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 16px; margin-top: 16px; }
        .card-source { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 12px; }
      </style>
    </head>
    <body>
      <div class="header">
        <h1>Spring的底层原理 - 学习卡片</h1>
      </div>
      <div class="grid-container">
        
    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">理论</div>
          <div class="card-question">Spring框架的三个核心底层原理是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">理论</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">Spring的底层原理基于依赖注入（DI）、控制反转（IOC）和面向切面编程（AOP），它们共同实现了模块化、松耦合的企业级应用开发。</div>
          </div>
          <div class="card-source">来源: Spring底层原理</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">理论</div>
          <div class="card-question">什么是Spring中的控制反转（IOC）？它的主要目的是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">理论</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">控制反转（IOC）是Spring的核心思想，它将应用程序的控制权从代码中转移到Spring容器。其主要目的是由容器负责管理对象的生命周期和依赖关系，从而实现组件间的松耦合和可测试性。</div>
          </div>
          <div class="card-source">来源: IOC(控制反转)</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">Spring提供了哪几种依赖注入（DI）的方式？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">Spring提供了多种依赖注入方式，主要包括构造函数注入、Setter注入和字段注入。开发者可以根据具体场景和需求进行选择。</div>
          </div>
          <div class="card-source">来源: DI(依赖注入)</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">理论</div>
          <div class="card-question">面向切面编程（AOP）解决了什么问题？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">理论</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">AOP通过将横切关注点（如日志、事务管理等）从核心业务逻辑中分离出来，解决了代码的模块化和可维护性问题，提高了代码的可重用性。</div>
          </div>
          <div class="card-source">来源: AOP(面向切面)</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">在Spring AOP中，一个切面（Aspect）由哪两个核心部分组成？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">一个切面（Aspect）通常由切点（Pointcut）和通知（Advice）组成。切点指定了在程序中的哪些位置应用通知，而通知则定义了切面在切点处执行的具体行为。</div>
          </div>
          <div class="card-source">来源: AOP(面向切面)</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">Spring AOP底层主要依赖哪两种动态代理技术？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">Spring AOP的底层实现主要基于两种动态代理方式：JDK动态代理和CGLIB动态代理。</div>
          </div>
          <div class="card-source">来源: AOP底层实现</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">JDK动态代理和CGLIB动态代理在使用上有什么关键区别？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">关键区别在于：JDK动态代理是基于接口的，要求目标对象必须实现接口；而CGLIB动态代理是基于类的，它通过在运行时动态生成目标类的子类来实现代理，因此不要求目标对象实现接口。</div>
          </div>
          <div class="card-source">来源: AOP底层实现</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">动态代理生成的类文件（.class）会默认保存在文件系统中吗？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">不会。动态代理生成的class文件通常是在内存中动态生成的，并不会直接生成为.class文件存储在文件系统中，因为它们是在运行时而非编译时生成。</div>
          </div>
          <div class="card-source">来源: 动态代理的有class文件吗</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">Spring AOP是如何将切面逻辑织入到目标对象中的？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">在运行时，Spring框架使用动态代理（JDK动态代理或CGLIB）来创建目标对象的代理对象。当应用程序调用目标对象的方法时，代理对象会先触发并执行切面中定义的通知（Advice），从而将切面逻辑织入到目标方法中。</div>
          </div>
          <div class="card-source">来源: AOP(面向切面)</div>
        </div>
      </div>
    </div>

      </div>
    </body>
    </html>
